<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label for="c-type" class="control-label col-xs-12 col-sm-2">{:__('Parent id')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_selectpicker('row[parent_id]', $parentList, $row.parent_id, ['data-rule'=>'required'])}
        </div>
    </div>
    <div class="form-group">
        <label for="c-name" class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_checkboxs('row[type][]', $typeList, $types)}
        </div>
    </div>
    <div class="form-group">
        <label for="c-name" class="control-label col-xs-12 col-sm-2">{:__('Shop Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-shop_name" data-rule="required" class="form-control" name="row[shop_name]" type="text" value="{$row.shop_name}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-name" class="control-label col-xs-12 col-sm-2">{:__('name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name}">
        </div>
    </div>
    <div class="form-group" style="display: none;">
        <label for="c-citycode" class="control-label col-xs-12 col-sm-2">{:__('Citycode')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-citycode" data-rule="" class="form-control" name="row[citycode]" type="text" value="{$row.citycode}">
        </div>
    </div>
    <div class="form-group" style="display: none;">
        <label for="c-adcode" class="control-label col-xs-12 col-sm-2">{:__('Adcode')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-adcode" data-rule="" class="form-control" name="row[adcode]" type="text" value="{$row.adcode}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-area_id" class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="button" id="iframes" class="btn btn-info">点击获取定位地址</button>
        </div>
    </div>
    <div class="form-group hide">
        <label for="c-area_id" class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-address" data-rule="" class="form-control address" name="row[address]" type="text" v-model="keyword" data-value="" ref="keyword" value="{$row.address}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-lat" class="control-label col-xs-12 col-sm-2">{:__('Lat')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-lat" data-rule="required" class="form-control lat" name="row[lat]" type="text" v-model="lat" data-value="" ref="lat" value="{$row.lat}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-lng" class="control-label col-xs-12 col-sm-2">{:__('Lng')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-lng" data-rule="required" class="form-control lng" name="row[lng]" type="text" v-model="lng" data-value="" ref="lng" value="{$row.lng}">
        </div>
    </div>
    <script>
        window.onload = function () {
            require.config({
                paths: {
                    'jquery': '../libs/jquery/dist/jquery.min',
                    'layer': '../libs/fastadmin-layer/dist/layer'
                }
            });
            require(['jquery', 'layer'],function($, layer){
                $('#iframes').on('click', function(){
                    // 禁用按钮防止重复提交
                    $("#job_address").attr({ disabled: "disabled" });//不加的话容易滑屏...
                    layer.open({
                        type: 2,
                        title: '腾讯地图定位',
                        maxmin: false,
                        shadeClose: true, //点击遮罩关闭层
                        area: ['550px', '105%'],
                        content: ["/map/map.html",'no']
                    });
                });
            });
        }
    </script>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed btn-reset">{:__('Reset')}</button>
        </div>
    </div>
</form>